The snippets window is comprised of two parts, the section dropdown and the list area.
When you click on the drop down tab of the section select
you will see the following choices: The section labels contain the section tag and then "::" followed by the section description. If you select "Add new section..." it will prompt you to add a new identifier and description to create a new section. |
In the listing area you will see all current snippets for the selected section, to insert the snippet into the file you will want to position your cursor where you want the code snippet to be inserted (or alternatively you can select a piece of text and the snippet will replace the selected text) and then double-click on the snippet label.
When you right-click on the empty area of the Snippet list area and you have text selected in the editor pane the "Make snippet" menu choice will be enabled allowing you to insert the selected text as a snippet into the current section. | When you right-click on an existing snippet while having text selected in the editor pane you will see the "Remove" and "Replace" menu options enabled. Both actions will operate on the snippet under the mouse when the right-click was performed. |
Make Snippet -- By selecting a block of text in the active editor and then right-clicking on a blank area of the Snippet list area you will be able to select "Insert" from the popup menu it will ask you for a label and then if the label does not conflict with an existing Snippet it will save the selected text into the currect section.
Replace -- By selecting a block of text in the active editor you can right-click on a current Snippet and choose "Replace" from the popup menu. It will ask you to confirm the replacement and if the user confirms the action then the selected Snippet text content will be replaced with the selected text from the active editor.
Remove -- By right-clicking on an item in the Snippet list area the user can select "Remove" from the popup menu and after asking for confirmation will remove the selected snippet from this section.
Extra features:
Within the text of the snippet you can embed to operators that will affect the cursor and/or text when the snippet is inserted.
"|" will tell the snippet where the cursor should be placed after the snippet is inserted, only the first symbol will be recognized, multiple inclusions of this symbol will be ignored.
"{$selected$}" can be used to make the snippet take selected text from the editor and replace it in the snippet then place the modified text back into place in the editor pane. For example:
Snippet | Text in the Editor with selection | Final text in the Editor |
for($i=0 ; $i < | ; $i++) { {$selected$} } |
echo "<table>\n";
echo "<tr><td> </td></tr>\n";
echo "</table>\n"; |
echo "<table>\n"; for($i=0 ; $i < | ; $i++) { echo "<tr><td> </td></tr>\n"; } echo "</table>\n"; |
© 2004, Maguma GmbH, All Rights Reserved
All content provided in this document belongs to Maguma unless noted as the property of another company, institution or person.
Reproduction is not allowed without consent by a representative of Maguma GmbH. Please contact info@maguma.com with any queries.